<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>mypetstore</title>
</head>
<body>
<div th:replace="common/admintop"></div>

<div id="Content">

    <div id="BackLink">
        <a href="/admin/viewProducts">Back</a>
    </div>

    <p align="center"><font color="green" th:text="${changeMsg}"></font></p>

    <div id="Catalog">

        <h3>Item Information</h3>

        <table class="rwd-table">
            <tr  class="trHead">
                <th><b>Item ID</b></th>
                <th><b>Description</b></th>
                <th><b>List Price</b></th>
                <th><b>Quantity</b></th>
                <th><b>Status</b></th>
                <th><b></b></th>
            </tr>
            <tr th:each="item:${itemList}">
                <td>
                    <a th:href="@{/admin/viewEditItem(itemId=${item.itemId})}">
                    <span th:text="${item.getItemId()}">item id</span>
                    </a>
                </td>
                <td th:text="${item.getAttribute1()}">description</td>
                <td th:text="${item.getListPrice()}">list price</td>
                <td th:text="${item.getStockQuantity()}">quantity</td>
                <td th:text="${item.getStatus()}">status</td>
                <td>
                    <a th:href="@{/admin/viewEditItem(itemId=${item.itemId})}" class="btn">edit</a>
                    <a th:href="@{/admin/removeItem(itemId=${item.itemId})}" class="btn">delete</a>
                    <span th:if="${item.getStatus() eq 'P'}">
                        <a th:href="@{/admin/changeItemStatus(itemId=${item.itemId})}" class="btn">&nbsp off &nbsp</a>
                    </span>
                    <span th:if="${item.getStatus() eq 'F'}">
                        <a th:href="@{/admin/changeItemStatus(itemId=${item.itemId})}" class="btn">&nbsp on &nbsp&nbsp</a>
                    </span>
                </td>
            </tr>
            <td colspan="6"><a th:href="@{/admin/viewAddItem(productId=${productId})}" class="btn">add</a></td>
        </table>

    </div>
</div>

<div th:replace="common/bottom"></div>
</body>
</html>